/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * frmMain.java
 *
 * Created on Oct 25, 2011, 1:44:45 PM
 */
package ttfsclient;

import static java.awt.SystemTray.getSystemTray;

import java.awt.AWTException;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.SystemTray;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.FileInputStream;
import java.net.InetAddress;
import java.net.URL;
import java.util.ArrayList;
import javax.swing.DefaultListModel;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.Timer;
import javax.swing.UIManager;
import myutil.Utility;
import pojo.POJODownload;
import pojo.POJODownloadClient;
import pojo.POJOFileClient;
import pojo.POJOFileUpload;
import pojo.POJOInfoClient;
import pojo.POJOInfoSharedFile;
import pojo.POJOMyInfo;
import org.apache.commons.codec.digest.DigestUtils;
import pojo.POJOProcess;

/**
 *
 * @author Tidus Le
 */
public class frmMain extends javax.swing.JFrame 
{
    public static boolean changeInfo=true;
    public static boolean connected=false;
    public static boolean changeFileUpload=true;
    public static boolean changeSharedList=false;
    public static boolean changeDownload=true;
    
    public static POJOMyInfo myInfo=new POJOMyInfo();
    public static ArrayList<POJOFileUpload> arrFileUpload=new ArrayList<POJOFileUpload>();
    public static ArrayList<POJOInfoSharedFile> arrInfoSharedFiles=new ArrayList<POJOInfoSharedFile>();
    public static ArrayList<POJOFileClient> arrFileClient=new ArrayList<POJOFileClient>();
    public static ArrayList<POJOInfoClient> arrInfoClient=new ArrayList<POJOInfoClient>();
    
    //variable for Download session
    public static ArrayList<POJODownload> arrDownload=new ArrayList<POJODownload>();
    public static ArrayList<POJODownloadClient> arrDownloadClient=new ArrayList<POJODownloadClient>();
    public static ArrayList<POJOProcess> arrProcess=new ArrayList<POJOProcess>();
    public static ArrayList<POJODownload> arrDownloadComplete=new ArrayList<POJODownload>();
    public static String tempDir=System.getProperty("java.io.tmpdir");
    public static final float maxData=500000;
    
    public static String fidPer="";
    long size=1;
    
    //variable for Open file
    String fPathOpen="";
    
    /** Creates new form frmMain */
    public frmMain() {
        initComponents();
        
        //resize form;
        this.setSize(new Dimension(this.getSize().width, 433));
        
        //Tray icon
        trayIcon();
        
        //Onload
        clsXMLMyInfo.readMyInfo(myInfo);
        clsXMLFileUpload.read(arrFileUpload);
        clsXMLDownload.read(arrDownload);
        clsXMLDownloadClient.read(arrDownloadClient);
        clsXMLDownloadComplete.read(arrDownloadComplete);
        
        //Chuyển những file đang download nào chưa xong về chế độ chờ, để kết nối lại
        for(POJODownload down:arrDownload)
            if(down.getStatus().equals("download")==true)
                down.setStatus("quee");
        
        try
        {
            clsRequestSV.dinhDanh(myInfo,InetAddress.getLocalHost().getHostAddress());
        }catch(Exception ex)
        {
            System.out.println(ex.getMessage());
        }
        lblID.setText(myInfo.getId());
        
        //start server threading
        clsThreadServer server=new clsThreadServer(Integer.parseInt(myInfo.getPort()));
        server.start();
        
        //Timer threading
        Timer timer=new Timer(200, new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                if(changeInfo==true)
                {
                    changeInfo=false;
                    loadMyInfo();
                    clsXMLMyInfo.writeMyInfo(myInfo);
                }
                
                if(connected==true)
                    lblStatus.setText("Connected");
                else
                    lblStatus.setText("Không thể kết nối đến server !");
                
                if(changeFileUpload==true)
                {
                    changeFileUpload=false;
                    clsXMLFileUpload.write(arrFileUpload);
                    loadFileUploadList();
                }
                
                if(changeSharedList==true)
                {
                    changeSharedList=false;
                    loadSharedFileList();
                }
                
                if(changeDownload==true)
                {
                    changeDownload=false;
                    clsXMLDownload.write(arrDownload);
                    clsXMLDownloadClient.write(arrDownloadClient);
                    clsXMLDownloadComplete.write(arrDownloadComplete);
                    loadDownloadFile();
                    loadDownloadComplete();
                }
                
                //Kiem tra download
                createDownload();
                
                //tính số lượng phần trăm download
                if(fidPer.isEmpty()==false)
                {
                    if(fidPer.equals("full")==true)
                    {
                        probarComplete.setValue(100);
                        probarComplete.setString("Finish");
                        lblDownloadComplete.setText("100%");
                        frmMain.this.setTitle("Client - Tata File Sharing");
                    }
                    else
                        if(fidPer.equals("")==false)
                        {
                            long currSize=Utility.sizeOfFolder(new File(tempDir+"\\"+fidPer));
                            long per=(currSize*100)/size;
                            probarComplete.setValue((int)per);
                            probarComplete.setString(per+"%");
                            lblDownloadComplete.setText(per+"%");
                            frmMain.this.setTitle(per+"%"+" - Client - Tata File Sharing");
                        }
                        else
                        {
                            //Khi không có gì
                            probarComplete.setValue(0);
                            probarComplete.setString("");
                            lblDownloadComplete.setText("");
                            frmMain.this.setTitle("Client - Tata File Sharing");                            
                        }
                }
            }
        });
        timer.start();
        
        
        //Start timer for download
        //Timer threading
        Timer timerDownload=new Timer(1000, new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                for(POJODownload down:arrDownload)
                    if(down.getStatus().equals("download")==true)
                    {
                        String fid=down.getFid();
                        boolean live=false;
                        
                        //Tìm xem còn thread download nao dang hoat dong hay khong
                        ThreadGroup thGroup=Thread.currentThread().getThreadGroup();
                        System.out.println(thGroup.activeCount());
                        Thread[] thr=new Thread[thGroup.activeCount()];
                        int n=thGroup.enumerate(thr, false);
                        for(int i=0;i<n;i++)
                        {
                            Thread t=thr[i];
                            if(t.getName().equals(fid)==true)
                            {
                                live=true;
                                break;
                            }
                        }
                        
                        //Nếu không có
                        if(live==false)
                        {
                            down.setStatus("quee");
                        }
                    }
            }
        });
        timerDownload.start();
    }
    
    /**
     * Thêm tray icon
     */
    private void trayIcon()
    {
        URL resource = getClass().getResource("/myutil/icon.png");
        Image image = Toolkit.getDefaultToolkit().getImage(resource);
        setIconImage(image);
        if (SystemTray.isSupported()) {
            final TrayIcon icon = new TrayIcon(image);
            icon.setToolTip("Tata File Sharing - Client");
            icon.setImageAutoSize(true);
            icon.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    frmMain.this.setVisible(true);
                    frmMain.this.setExtendedState(frmMain.NORMAL);
                    getSystemTray().remove(icon);
                }

            });
            addWindowListener(new WindowAdapter() {

                @Override
                public void windowIconified(WindowEvent e) {
                    frmMain.this.setVisible(false);
                    try {
                        getSystemTray().add(icon);
                    } catch (AWTException e1) {
                        e1.printStackTrace();
                    }
                }

            });
        }
    }
    
    //////////////////////////////////////
    //Tao ra các threading download file//
    //////////////////////////////////////
    private void createDownload()
    {
        for(POJODownload down:arrDownload)
            if(down.getStatus().equals("quee")==true)
            {
                down.setStatus("download");
                int delay=1;
                for(POJODownloadClient dc:arrDownloadClient)
                    if(dc.getFid().equals(down.getFid())==true)
                    {
                        new clsThreadDownload(dc.getCid(), down, delay).start();
                        delay+=3;
                    }
                
                clsXMLDownload.write(arrDownload);
            }
    }
    
    /**
     * Load thông tin của máy tính
     */
    private void loadMyInfo()
    {
        this.lblID.setText(myInfo.getId());
        try
        {
            this.lblHostName.setText(InetAddress.getLocalHost().getHostName());
            this.lblMyIP.setText(InetAddress.getLocalHost().getHostAddress());
        }catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
    
    /**
     * Load danh sách những file đang chia sẻ
     */
    private void loadFileUploadList()
    {
        DefaultListModel model=new DefaultListModel();
        for(POJOFileUpload fu:arrFileUpload)
        {
            try
            {
                File f=new File(fu.getPath());
                model.addElement(f.getName());
            }catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
        }
        listFileUpload.setModel(model);
    }
    
    /**
     * Load danh sách các file được chia sẻ, lấy từ server
     */
    private void loadSharedFileList()
    {
        DefaultListModel model=new DefaultListModel();
        for(POJOInfoSharedFile fu:arrInfoSharedFiles)
        {
            try
            {
                model.addElement(fu.getName());
            }catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
        }
        listSharedFile.setModel(model);
    }
    
    /**
     * Load danh sach những file đang download
     */
    private void loadDownloadFile()
    {
        DefaultListModel model=new DefaultListModel();
        for(POJODownload fu:arrDownload)
        {
            try
            {
                model.addElement(fu.getFname());
            }catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
        }
        listDownloadFile.setModel(model);
    }
    
    /**
     * load ra danh sach client ma file nay download
     * @param fid 
     */
    private void loadDownloadClient(String fid)
    {
        DefaultListModel model=new DefaultListModel();
        for(POJODownloadClient fu:arrDownloadClient)
        {
            if(fu.getFid().equals(fid)==true)
            {
                try
                {
                    model.addElement(fu.getCname()+" | "+fu.getCid());
                }catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }
            }
        }
        listDownloadClient.setModel(model);
    }
    
    /**
     * Hiện thị thông tin và danh sách của file đang download
     */
    private void loadInfoDownloadFile(String fid,ArrayList<POJODownload> arr)
    {
        loadDownloadClient(fid);
        for(POJODownload down:arr)
            if(down.getFid().equals(fid)==true)
            {
                this.lblDownloadFileName.setText(down.getFname());
                this.lblDownloadPath.setText(down.getFpath());
                this.lblDownloadSize.setText(Utility.getSize(down.getFsize()));
                if(down.getStatus().equals("quee")==true)
                    this.lblDownloadStatus.setText("Đang chờ download");
                else
                    if(down.getStatus().equals("stop")==true)
                        this.lblDownloadStatus.setText("Tạm dừng");
                    else
                        if(down.getStatus().equals("download")==true)
                            this.lblDownloadStatus.setText("Đang tiến hành download");
                        else
                            if(down.getStatus().equals("finish")==true)
                                this.lblDownloadStatus.setText("Đã hoàn tất");
            }
    }
    
    /**
     * Load danh sách các file đã hoàn thành
     */
    private void loadDownloadComplete()
    {
        DefaultListModel model=new DefaultListModel();
        for(POJODownload fu:arrDownloadComplete)
        {
            try
            {
                model.addElement(fu.getFname());
            }catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
        }
        listDownloadComplete.setModel(model);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        fileChooser = new javax.swing.JFileChooser();
        listFileClientID = new javax.swing.JList();
        pmnuFile = new javax.swing.JPopupMenu();
        mnuOpen = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        mnuOpenFolder = new javax.swing.JMenuItem();
        jPanel6 = new javax.swing.JPanel();
        jPanel7 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        listDownloadComplete = new javax.swing.JList();
        btnCompleteDelete = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        lblDownloadFileName = new javax.swing.JLabel();
        lblDownloadSize = new javax.swing.JLabel();
        lblDownloadStatus = new javax.swing.JLabel();
        jScrollPane6 = new javax.swing.JScrollPane();
        lblDownloadPath = new javax.swing.JTextArea();
        jLabel16 = new javax.swing.JLabel();
        lblDownloadComplete = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        listDownloadFile = new javax.swing.JList();
        btnDownloadDelete = new javax.swing.JButton();
        btnStop = new javax.swing.JButton();
        btnResume = new javax.swing.JButton();
        jPanel10 = new javax.swing.JPanel();
        jScrollPane7 = new javax.swing.JScrollPane();
        listDownloadClient = new javax.swing.JList();
        jPanel11 = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        lblID = new javax.swing.JLabel();
        lblStatus = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        lblHostName = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        lblMyIP = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        lblFileID = new javax.swing.JLabel();
        lblFileName = new javax.swing.JLabel();
        lblFileSize = new javax.swing.JLabel();
        lblFilePath = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        listSharedFile = new javax.swing.JList();
        btnGetList = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        listFileClient = new javax.swing.JList();
        btnDownload = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        listFileUpload = new javax.swing.JList();
        btnShareFile = new javax.swing.JButton();
        btnUploadDelete = new javax.swing.JButton();
        probarComplete = new javax.swing.JProgressBar();
        btnShowMore = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        mnuExit = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        mnuConfig = new javax.swing.JMenuItem();
        mnuHelp = new javax.swing.JMenu();
        mnuAbout = new javax.swing.JMenuItem();

        fileChooser.setDialogTitle("Open file which you want to share...");

        listFileClientID.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);

        mnuOpen.setText("Open");
        mnuOpen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuOpenActionPerformed(evt);
            }
        });
        pmnuFile.add(mnuOpen);
        pmnuFile.add(jSeparator1);

        mnuOpenFolder.setText("Open Folder");
        mnuOpenFolder.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuOpenFolderActionPerformed(evt);
            }
        });
        pmnuFile.add(mnuOpenFolder);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Client - Tata File Sharing");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Đã hoàn thành", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        listDownloadComplete.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        listDownloadComplete.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                listDownloadCompleteMouseClicked(evt);
            }
        });
        listDownloadComplete.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                listDownloadCompleteValueChanged(evt);
            }
        });
        jScrollPane5.setViewportView(listDownloadComplete);

        btnCompleteDelete.setText("Delete");
        btnCompleteDelete.setEnabled(false);
        btnCompleteDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCompleteDeleteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(btnCompleteDelete, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
            .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnCompleteDelete))
        );

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Thông tin", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        jLabel9.setText("File Name:");

        jLabel10.setText("Size:");

        jLabel11.setText("Status:");

        jLabel12.setText("Path Save");

        lblDownloadFileName.setForeground(new java.awt.Color(102, 0, 255));

        lblDownloadSize.setForeground(new java.awt.Color(102, 0, 255));

        lblDownloadStatus.setForeground(new java.awt.Color(102, 0, 255));

        jScrollPane6.setBorder(null);

        lblDownloadPath.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.background"));
        lblDownloadPath.setColumns(20);
        lblDownloadPath.setEditable(false);
        lblDownloadPath.setForeground(new java.awt.Color(102, 0, 255));
        lblDownloadPath.setLineWrap(true);
        lblDownloadPath.setRows(1);
        lblDownloadPath.setAutoscrolls(false);
        lblDownloadPath.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
        jScrollPane6.setViewportView(lblDownloadPath);

        jLabel16.setText("Complete:");

        lblDownloadComplete.setForeground(new java.awt.Color(102, 0, 255));

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblDownloadFileName, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblDownloadSize, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblDownloadStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel16)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblDownloadComplete, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE))
                    .addComponent(jLabel12, javax.swing.GroupLayout.Alignment.LEADING))
                .addContainerGap())
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(lblDownloadFileName))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(lblDownloadSize))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(lblDownloadStatus))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(lblDownloadComplete))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel12)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 47, Short.MAX_VALUE))
        );

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Đang download", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        listDownloadFile.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        listDownloadFile.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                listDownloadFileValueChanged(evt);
            }
        });
        jScrollPane4.setViewportView(listDownloadFile);

        btnDownloadDelete.setText("Delete");
        btnDownloadDelete.setEnabled(false);
        btnDownloadDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDownloadDeleteActionPerformed(evt);
            }
        });

        btnStop.setText("Stop");
        btnStop.setEnabled(false);
        btnStop.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnStopActionPerformed(evt);
            }
        });

        btnResume.setText("Resume");
        btnResume.setEnabled(false);
        btnResume.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnResumeActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(btnDownloadDelete, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addComponent(btnResume, javax.swing.GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnStop, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnResume)
                    .addComponent(btnStop))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnDownloadDelete))
        );

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Download từ Client", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        listDownloadClient.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane7.setViewportView(listDownloadClient);

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 239, Short.MAX_VALUE)
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap(92, Short.MAX_VALUE)
                .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap(178, Short.MAX_VALUE))
        );

        jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "My Info", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        jLabel1.setText("My ID:");

        lblID.setForeground(new java.awt.Color(102, 0, 204));

        lblStatus.setForeground(new java.awt.Color(102, 0, 204));
        lblStatus.setText("Không thể kết nối đến server !");

        jLabel2.setText("Status:");

        jLabel7.setText("Computer Name:");

        lblHostName.setForeground(new java.awt.Color(102, 0, 204));

        jLabel8.setText("My IP:");

        lblMyIP.setForeground(new java.awt.Color(102, 0, 204));

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblID, javax.swing.GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblHostName, javax.swing.GroupLayout.DEFAULT_SIZE, 108, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel8)
                            .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(lblMyIP, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(lblStatus, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE))))
                .addGap(118, 118, 118))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(lblID))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(lblHostName))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(lblMyIP))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(lblStatus))
                .addContainerGap())
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Thông tin file", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        jLabel3.setText("File ID:");

        jLabel4.setText("File name:");

        jLabel5.setText("File size:");

        jLabel6.setText("Path:");

        lblFileID.setForeground(new java.awt.Color(102, 0, 204));

        lblFileName.setForeground(new java.awt.Color(102, 0, 204));

        lblFileSize.setForeground(new java.awt.Color(102, 0, 204));

        lblFilePath.setForeground(new java.awt.Color(102, 0, 204));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblFileName, javax.swing.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lblFileID, javax.swing.GroupLayout.DEFAULT_SIZE, 348, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblFileSize, javax.swing.GroupLayout.DEFAULT_SIZE, 345, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblFilePath, javax.swing.GroupLayout.DEFAULT_SIZE, 360, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(lblFileID))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(lblFileName))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(lblFileSize))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(lblFilePath)))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Danh sách file từ server", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        listSharedFile.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        listSharedFile.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                listSharedFileValueChanged(evt);
            }
        });
        jScrollPane2.setViewportView(listSharedFile);

        btnGetList.setText("Lấy danh sách");
        btnGetList.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGetListActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(btnGetList, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnGetList))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Các Client chia sẻ file", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        listFileClient.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                listFileClientValueChanged(evt);
            }
        });
        jScrollPane3.setViewportView(listFileClient);

        btnDownload.setText("Download");
        btnDownload.setEnabled(false);
        btnDownload.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDownloadActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(btnDownload, javax.swing.GroupLayout.DEFAULT_SIZE, 206, Short.MAX_VALUE)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 206, Short.MAX_VALUE)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnDownload))
        );

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Danh sách file đang upload", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        listFileUpload.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        listFileUpload.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                listFileUploadMouseClicked(evt);
            }
        });
        listFileUpload.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                listFileUploadValueChanged(evt);
            }
        });
        jScrollPane1.setViewportView(listFileUpload);

        btnShareFile.setText("Share File");
        btnShareFile.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnShareFileActionPerformed(evt);
            }
        });

        btnUploadDelete.setText("Delete");
        btnUploadDelete.setEnabled(false);
        btnUploadDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnUploadDeleteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(btnUploadDelete, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnShareFile, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE)
                .addGap(2, 2, 2))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnUploadDelete)
                    .addComponent(btnShareFile)))
        );

        probarComplete.setForeground(new java.awt.Color(102, 0, 255));
        probarComplete.setString("0 %");
        probarComplete.setStringPainted(true);

        btnShowMore.setText("More");
        btnShowMore.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnShowMoreActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE)))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                .addComponent(probarComplete, javax.swing.GroupLayout.DEFAULT_SIZE, 583, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnShowMore))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel5, 0, 101, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 101, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(probarComplete, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnShowMore)))
        );

        jMenu1.setText("File");

        mnuExit.setText("Exit");
        mnuExit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuExitActionPerformed(evt);
            }
        });
        jMenu1.add(mnuExit);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Edit");

        mnuConfig.setText("Configuration");
        mnuConfig.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuConfigActionPerformed(evt);
            }
        });
        jMenu2.add(mnuConfig);

        jMenuBar1.add(jMenu2);

        mnuHelp.setText("Help");

        mnuAbout.setText("About");
        mnuAbout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuAboutActionPerformed(evt);
            }
        });
        mnuHelp.add(mnuAbout);

        jMenuBar1.add(mnuHelp);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        clsRequestSV.offline(myInfo);
    }//GEN-LAST:event_formWindowClosing

    private void btnShareFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnShareFileActionPerformed
        try
        {
            int result=fileChooser.showOpenDialog(this);
            if(result==JFileChooser.APPROVE_OPTION)
            {
                File f=fileChooser.getSelectedFile();
                FileInputStream fInStr=new FileInputStream(f);
                String fid=DigestUtils.md5Hex(fInStr);

                clsRequestSV.shareFile(fid, f.getName(), f.length(),myInfo);

                //lưu thông tin lại
                boolean exist=false;
                for(POJOFileUpload fuload:arrFileUpload)
                    if(fuload.getFid().equals(fid)==true)
                    {
                        exist=true;
                        break;
                    }

                if(exist==false)
                {
                    POJOFileUpload fu=new POJOFileUpload();
                    fu.setFid(fid);
                    fu.setPath(f.getPath());
                    frmMain.changeFileUpload=true;
                    frmMain.arrFileUpload.add(fu);
                }
            }
        }catch(Exception e)
        {
            JOptionPane.showMessageDialog(new JFrame(), e.getMessage(),"Lỗi !",JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_btnShareFileActionPerformed

    private void listFileUploadValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_listFileUploadValueChanged
        if(listFileUpload.getSelectedIndex()>=0)
        {
            btnUploadDelete.setEnabled(true);
            listSharedFile.clearSelection();
            try
            {
                File f=new File(arrFileUpload.get(listFileUpload.getSelectedIndex()).getPath());
                this.lblFileID.setText(arrFileUpload.get(listFileUpload.getSelectedIndex()).getFid());
                this.lblFilePath.setText(arrFileUpload.get(listFileUpload.getSelectedIndex()).getPath());
                this.lblFileName.setText(f.getName());
                this.lblFileSize.setText(Utility.getSize(f.length()));
            }catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
        }
        else
            btnUploadDelete.setEnabled(false);
    }//GEN-LAST:event_listFileUploadValueChanged

    private void btnGetListActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGetListActionPerformed
        clsRequestSV.getLlistSharedFile(myInfo);
    }//GEN-LAST:event_btnGetListActionPerformed

    private void listSharedFileValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_listSharedFileValueChanged
        if(listSharedFile.getSelectedIndex()>=0)
        {
            listFileUpload.clearSelection();
            
            //show information
            String fid=arrInfoSharedFiles.get(listSharedFile.getSelectedIndex()).getFid();
            this.lblFileID.setText(fid);
            this.lblFileName.setText(arrInfoSharedFiles.get(listSharedFile.getSelectedIndex()).getName());
            this.lblFileSize.setText(Utility.getSize(arrInfoSharedFiles.get(listSharedFile.getSelectedIndex()).getSize()));
            this.lblFilePath.setText("");
            
            //show client
            DefaultListModel model=new DefaultListModel();
            DefaultListModel model_cid=new DefaultListModel();
            for(POJOFileClient fc:arrFileClient)
                if(fc.getFid().equals(fid)==true)
                {
                    for(POJOInfoClient ic:arrInfoClient)
                    {
                        if(ic.getId().equals(fc.getCid())==true)
                        {
                            try
                            {
                                model_cid.addElement(ic.getId());
                                if(ic.getStatus().equals("on")==true)
                                    model.addElement(ic.getName()+" | "+ic.getId()+" | Online");
                                else
                                    model.addElement(ic.getName()+" | "+ic.getId()+" | [Offline]");
                            }catch(Exception e)
                            {
                                System.out.println(e.getMessage());
                            }
                        }
                    }
                }
            listFileClientID.setModel(model_cid);
            listFileClient.setModel(model);
        }
    }//GEN-LAST:event_listSharedFileValueChanged

    private void listFileClientValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_listFileClientValueChanged
        if(listFileClient.getSelectedIndex()>=0)
            btnDownload.setEnabled(true);
        else
            btnDownload.setEnabled(false);
    }//GEN-LAST:event_listFileClientValueChanged

    private void btnUploadDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUploadDeleteActionPerformed
        if(listFileUpload.getSelectedIndex()>=0)
        {
            String fid=arrFileUpload.get(listFileUpload.getSelectedIndex()).getFid();
            clsRequestSV.deleteSharedFile(myInfo, fid);
            
            arrFileUpload.remove(listFileUpload.getSelectedIndex());
            //notify to frmMain
            frmMain.changeFileUpload=true;
        }
    }//GEN-LAST:event_btnUploadDeleteActionPerformed

    private void btnDownloadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDownloadActionPerformed
        if(listFileClient.getSelectedIndex()>=0)
        {
            String fileName=arrInfoSharedFiles.get(listSharedFile.getSelectedIndex()).getName();
            String fid=arrInfoSharedFiles.get(listSharedFile.getSelectedIndex()).getFid();
            //Kiem tra ton tai hay chua
            for(POJODownload down:arrDownload)
                if(down.getFid().equals(fid)==true)
                {
                    JOptionPane.showMessageDialog(this, "File này đang download rồi! Bạn hãy chọn file khác.","Thông báo",JOptionPane.WARNING_MESSAGE);
                    return;
                }
            
            fileChooser.setSelectedFile(new File(fileName));
            int result=fileChooser.showSaveDialog(this);
            if(result==JFileChooser.APPROVE_OPTION)
            {
                String path=fileChooser.getSelectedFile().getPath();
                
                POJODownload down=new POJODownload();
                down.setFid(fid);
                down.setFname(fileName);
                down.setFpath(path);
                down.setFsize(arrInfoSharedFiles.get(listSharedFile.getSelectedIndex()).getSize());
                down.setStatus("quee");
                arrDownload.add(down); //add
                
                //add vô danh sách chia sẻ file trên server
                clsRequestSV.shareFile(fid, fileName, arrInfoSharedFiles.get(listSharedFile.getSelectedIndex()).getSize(), myInfo);
                
                POJODownloadClient downClient;
                int[] cid=listFileClient.getSelectedIndices();
                
                for(int i:cid)
                {
                    downClient=new POJODownloadClient();
                    downClient.setFid(fid);
                    String clientid=(String)listFileClientID.getModel().getElementAt(i);
                    downClient.setCid(clientid);
                    for(POJOInfoClient ic:arrInfoClient)
                        if(ic.getId().equals(clientid)==true)
                            downClient.setCname(ic.getName());
                    
                    //Tim xem đã có trong mảng danh sách hay chưa
                    boolean exist=false;
                    for(POJODownloadClient dc:arrDownloadClient)
                        if((dc.getFid().equals(downClient.getFid())==true)&&(dc.getCid().equals(downClient.getCid())==true))
                        {
                            exist=true;
                            break;
                        }
                    
                    if(exist==false)
                        arrDownloadClient.add(downClient); //add
                }
                
                //notify to change data
                fidPer=fid;
                size=arrInfoSharedFiles.get(listSharedFile.getSelectedIndex()).getSize();
                loadInfoDownloadFile(fidPer,arrDownload);
                frmMain.changeDownload=true;
            }
        }
    }//GEN-LAST:event_btnDownloadActionPerformed

    private void listDownloadFileValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_listDownloadFileValueChanged
        if(listDownloadFile.getSelectedIndex()>=0)
        {
            listDownloadComplete.clearSelection();
            fidPer=arrDownload.get(listDownloadFile.getSelectedIndex()).getFid();
            size=arrDownload.get(listDownloadFile.getSelectedIndex()).getFsize();
            loadInfoDownloadFile(fidPer,arrDownload);
            
            if(arrDownload.get(listDownloadFile.getSelectedIndex()).getStatus().equals("download")==true)
            {
                btnStop.setEnabled(true);
                btnResume.setEnabled(false);
                btnDownloadDelete.setEnabled(false);
            }
            else
                if(arrDownload.get(listDownloadFile.getSelectedIndex()).getStatus().equals("stop")==true)
                {
                    btnStop.setEnabled(false);
                    btnResume.setEnabled(true);
                    btnDownloadDelete.setEnabled(true);
                }
                else
                {
                    btnStop.setEnabled(false);
                    btnResume.setEnabled(false);
                    btnDownloadDelete.setEnabled(false);
                }
                    
        }
        else
        {
            btnDownloadDelete.setEnabled(false);
            btnStop.setEnabled(false);
            btnResume.setEnabled(false);
        }
    }//GEN-LAST:event_listDownloadFileValueChanged

    private void listDownloadCompleteValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_listDownloadCompleteValueChanged
        if(listDownloadComplete.getSelectedIndex()>=0)
        {
            btnCompleteDelete.setEnabled(true);
            listDownloadFile.clearSelection();
            fidPer="full";
            size=1;
            loadInfoDownloadFile(arrDownloadComplete.get(listDownloadComplete.getSelectedIndex()).getFid(),arrDownloadComplete);
        }
        else
            btnCompleteDelete.setEnabled(false);
    }//GEN-LAST:event_listDownloadCompleteValueChanged

    private void btnStopActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStopActionPerformed
        if(listDownloadFile.getSelectedIndex()>=0)
        {
            arrDownload.get(listDownloadFile.getSelectedIndex()).setStatus("stop");
            loadInfoDownloadFile(fidPer,arrDownload);
            clsXMLDownload.write(arrDownload);
            
            //set enable của button
            btnStop.setEnabled(false);
            btnResume.setEnabled(true);
            btnDownloadDelete.setEnabled(true);
            //frmMain.changeDownload=true;
        }
    }//GEN-LAST:event_btnStopActionPerformed

    private void btnResumeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnResumeActionPerformed
        if(listDownloadFile.getSelectedIndex()>=0)
        {
            arrDownload.get(listDownloadFile.getSelectedIndex()).setStatus("quee");
            loadInfoDownloadFile(fidPer,arrDownload);
            clsXMLDownload.write(arrDownload);
            
            //set enable của button
            btnStop.setEnabled(true);
            btnResume.setEnabled(false);
            btnDownloadDelete.setEnabled(false);
            //frmMain.changeDownload=true;
        }
    }//GEN-LAST:event_btnResumeActionPerformed

    private void btnDownloadDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDownloadDeleteActionPerformed
        if(listDownloadFile.getSelectedIndex()>=0)
        {
            //clear info
            listDownloadClient.clearSelection();
            this.lblDownloadComplete.setText("");
            this.lblDownloadFileName.setText("");
            this.lblDownloadPath.setText("");
            this.lblDownloadSize.setText("");
            this.lblDownloadStatus.setText("");
            this.fidPer="";
            
            String fid=arrDownload.get(listDownloadFile.getSelectedIndex()).getFid();
            for(POJODownload down:arrDownload)
                if(down.getFid().equals(fid)==true)
                {
                    arrDownload.remove(down);
                    break;
                }
            
            //xóa pack trong mảng arrProcess
            int c=0;
            while(c<arrDownloadClient.size())
            {
                if(arrDownloadClient.get(c).getFid().equals(fid)==true)
                    arrDownloadClient.remove(c);
                else
                    c++;
            }
            
            frmMain.changeDownload=true;
        }
    }//GEN-LAST:event_btnDownloadDeleteActionPerformed

    private void mnuExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuExitActionPerformed
        clsRequestSV.offline(myInfo);
        System.exit(0);
    }//GEN-LAST:event_mnuExitActionPerformed

    private void mnuConfigActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuConfigActionPerformed
        frmConfigDlg config=new frmConfigDlg(this, true);
        config.setVisible(true);
    }//GEN-LAST:event_mnuConfigActionPerformed

    private void btnShowMoreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnShowMoreActionPerformed
        if(btnShowMore.getText().equals("More")==true)
        {
            this.setSize(new Dimension(this.getSize().width, 723));
            btnShowMore.setText("Less");
        }
        else
        {
            this.setSize(new Dimension(this.getSize().width, 433));
            btnShowMore.setText("More");
        }
    }//GEN-LAST:event_btnShowMoreActionPerformed

    private void mnuAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuAboutActionPerformed
        frmAbout about=new frmAbout(this, true);
        about.setVisible(true);
    }//GEN-LAST:event_mnuAboutActionPerformed

    private void btnCompleteDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCompleteDeleteActionPerformed
        if(listDownloadComplete.getSelectedIndex()>=0)
        {
            //clear info
            listDownloadClient.clearSelection();
            this.lblDownloadComplete.setText("");
            this.lblDownloadFileName.setText("");
            this.lblDownloadPath.setText("");
            this.lblDownloadSize.setText("");
            this.lblDownloadStatus.setText("");
            this.fidPer="";
            
            String fid=arrDownloadComplete.get(listDownloadComplete.getSelectedIndex()).getFid();
            for(POJODownload down:arrDownloadComplete)
                if(down.getFid().equals(fid)==true)
                {
                    arrDownloadComplete.remove(down);
                    break;
                }
            
            //xóa pack trong mảng arrProcess
            int c=0;
            while(c<arrDownloadClient.size())
            {
                if(arrDownloadClient.get(c).getFid().equals(fid)==true)
                    arrDownloadClient.remove(c);
                else
                    c++;
            }
            
            frmMain.changeDownload=true;
        }
    }//GEN-LAST:event_btnCompleteDeleteActionPerformed

    private void listDownloadCompleteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_listDownloadCompleteMouseClicked
        if(listDownloadComplete.getSelectedIndex()>=0)
            if(evt.getClickCount()==2)
            {
                (new clsThreadOpenFile(arrDownloadComplete.get(listDownloadComplete.getSelectedIndex()).getFpath())).start();
            }
            else
                if(evt.getButton()==MouseEvent.BUTTON3)
                {
                    fPathOpen=arrDownloadComplete.get(listDownloadComplete.getSelectedIndex()).getFpath();
                    pmnuFile.show(evt.getComponent(), evt.getX(), evt.getY());
                }
    }//GEN-LAST:event_listDownloadCompleteMouseClicked

    private void listFileUploadMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_listFileUploadMouseClicked
        if(listFileUpload.getSelectedIndex()>=0)
            if(evt.getClickCount()==2)
            {
                (new clsThreadOpenFile(arrFileUpload.get(listFileUpload.getSelectedIndex()).getPath())).start();
            }
            else
                if(evt.getButton()==MouseEvent.BUTTON3)
                {
                    fPathOpen=arrFileUpload.get(listFileUpload.getSelectedIndex()).getPath();
                    pmnuFile.show(evt.getComponent(), evt.getX(), evt.getY());
                }
    }//GEN-LAST:event_listFileUploadMouseClicked

    private void mnuOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuOpenActionPerformed
        (new clsThreadOpenFile(fPathOpen)).start();
    }//GEN-LAST:event_mnuOpenActionPerformed

    private void mnuOpenFolderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuOpenFolderActionPerformed
        (new clsThreadOpenFile(new File(fPathOpen).getParent())).start();
    }//GEN-LAST:event_mnuOpenFolderActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                try
                {
                    UIManager.setLookAndFeel("com.jtattoo.plaf.mcwin.McWinLookAndFeel");
                }catch(Exception e)
                {
                    e.printStackTrace();
                }
                new frmMain().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCompleteDelete;
    private javax.swing.JButton btnDownload;
    private javax.swing.JButton btnDownloadDelete;
    private javax.swing.JButton btnGetList;
    private javax.swing.JButton btnResume;
    private javax.swing.JButton btnShareFile;
    private javax.swing.JButton btnShowMore;
    private javax.swing.JButton btnStop;
    private javax.swing.JButton btnUploadDelete;
    private javax.swing.JFileChooser fileChooser;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JLabel lblDownloadComplete;
    private javax.swing.JLabel lblDownloadFileName;
    private javax.swing.JTextArea lblDownloadPath;
    private javax.swing.JLabel lblDownloadSize;
    private javax.swing.JLabel lblDownloadStatus;
    private javax.swing.JLabel lblFileID;
    private javax.swing.JLabel lblFileName;
    private javax.swing.JLabel lblFilePath;
    private javax.swing.JLabel lblFileSize;
    private javax.swing.JLabel lblHostName;
    private javax.swing.JLabel lblID;
    private javax.swing.JLabel lblMyIP;
    private javax.swing.JLabel lblStatus;
    private javax.swing.JList listDownloadClient;
    private javax.swing.JList listDownloadComplete;
    private javax.swing.JList listDownloadFile;
    private javax.swing.JList listFileClient;
    private javax.swing.JList listFileClientID;
    private javax.swing.JList listFileUpload;
    private javax.swing.JList listSharedFile;
    private javax.swing.JMenuItem mnuAbout;
    private javax.swing.JMenuItem mnuConfig;
    private javax.swing.JMenuItem mnuExit;
    private javax.swing.JMenu mnuHelp;
    private javax.swing.JMenuItem mnuOpen;
    private javax.swing.JMenuItem mnuOpenFolder;
    private javax.swing.JPopupMenu pmnuFile;
    private javax.swing.JProgressBar probarComplete;
    // End of variables declaration//GEN-END:variables
}
